// import { param2Obj } from '@/utils';

const faker = require('faker');

faker.locale = 'zh_CN';

// 库存总览列表
const inventoryViews = [];
for (let i = 0; i < 20; i++) {
  inventoryViews.push({
    id: i + 1,
    skuId: faker.random.uuid(),
    skuName: `物料${i + 1}`,
    brand: Math.round(Math.random() * 2),
    spec: `规格${Math.round(Math.random())}`,
    unit: Math.round(Math.random() * 3),
    bomvertion: faker.random.uuid(),
    category: Math.round(Math.random() * 3),
    grade: Math.round(Math.random() * 3),
    stores: `仓库${i + 1}`,
    quantity: Math.round(Math.random() * 100),
    validate: Math.round(Math.random() * 365)
  });
}
const recordList = [];
for (let i = 0; i < 10; i++) {
  recordList.push({
    time: (new Date()).toLocaleDateString(),
    creator: `经办人${faker.random.word(1)}`,
    skuType: `单据类型${faker.random.word(1)}`,
    skuId: faker.random.uuid(),
    storehouseName: `仓库${faker.random.word(1)}`,
    storageSite: `仓位${faker.random.word(1)}`,
    batchNo: `批号${faker.random.number(99)}`,
    serialNo: `序列号${faker.random.number(99)}`,
    modifyQuantity: faker.random.number(999999),
    balanceQuantity: faker.random.number(999999),
    inventoryUnit: `库存单位${faker.random.number(9)}`,
    inventoryState: `库存状态${faker.random.number(9)}`,
    remark: '我是备注',
  });
}
const warningList = [];
for (let i = 0; i < 10; i++) {
  warningList.push({
    storehouseName: `仓库${faker.random.word(1)}`,
    storageSite: `仓位${faker.random.word(1)}`,
    batchNo: `批号${faker.random.number(99)}`,
    serialNo: `序列号${faker.random.number(99)}`,
    quantity: faker.random.number(999999),
    inventoryState: `库存状态${faker.random.number(9)}`,
    warningUp: faker.random.number(9999999),
    warningDown: faker.random.number(99),
    validityDate: (new Date()).toLocaleDateString(),
    validityDay: Math.round(Math.random() * 1000),
    warningDay: Math.round(Math.random() * 1000),
    validityValue: Math.round(Math.random() * 9999)
  });
}
export default {
  getInventoryOverview: () => ({
    totalPageNum: 1,
    totalNum: 102,
    records: inventoryViews
  }),
  getRecordList: () => ({
    status: 0,
    comment: '描述信息',
    obj: {
      pageSize: 20,
      pageNum: 1,
      totalNum: 58,
      records: recordList,
      recordStartNum: 11,
      recordEndNum: 89,
      totalInboundNum: 67,
      totalOutboundNum: 45
    }
  }),
  getWarningList: () => ({
    // const skuId = param2Obj(config.url).skuId;
    status: 0,
    comment: '描述信息',
    obj: {
      pageSize: 20,
      pageNum: 1,
      totalNum: 62,
      records: warningList
    }
  })
};
